<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>navigator对象</title>
</head>
<body>
    <script>
        if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|woSBrowser|BrowserNG|Webos|Symbian|Windows phone)/i))) {
            window.location.href = "";  //手机
        }else{
            window.location.href = "";   //电脑
        }
    </script>
</body>
</html>